﻿namespace 一
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入长方形的长和宽");
            double length = Convert.ToDouble(Console.ReadLine());
            double width = Convert.ToDouble(Console.ReadLine());
            Rectangle rect = new Rectangle(length, width);
            Console.WriteLine("面积为：" + rect.Area());
            Console.WriteLine("周长为：" + rect.Perimeter());
        }
    }
    class Rectangle
    {
        private double length, width;
        public Rectangle()
        {
            length = 1;
            width = 1;
        }
        public Rectangle(double l,double w)
        {
            length = l;
            width = w;
        }
        public double Area()
        {
            return length * width;
        }
        public double Perimeter()
        {
            return 2 * (length + width);
        }
    }
}
